<template>
  <div class="editAreaContentWrapper">
    <EditAreaTool />
    <InputComponent @send="sendMessage"/>
  </div>
</template>
<script lang="ts" setup>
import useChatStore from '@/stores/chatStore'
import EditAreaTool from './EditAreaTool.vue'
import InputComponent from './InputComponent.vue'
const chatStore = useChatStore()
/**
 * 发送消息
 * @param msg 
 */
const sendMessage = (data: any) => {
  // 这里需要区分是表情包 还是 上传的图片 如果是上传的图片需要把当前的消息分为若干条发送（文本消息 + 上传的图片 + 文本消息）三条发送
  chatStore.sendMessage(data.type, data.message, data.imgs, data.video, data.video)  // 调用发送消息接口
}
</script>
<style lang="less" scoped>
.editAreaContentWrapper {
  height: 100%;
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
}
</style>
